package com.ize.ZidingyiZhujie;



import com.ize.validation.StateValidation;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

@Documented//元注解
@Constraint(
        validatedBy = {StateValidation.class}//指定提供规则类
)
@Target(FIELD)
@Retention(RUNTIME)
public @interface State {

    String message() default "state参数的值只能发布或草稿";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
